package com.usian.behavior.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usian.behavior.service.ApFollowBehaviorService;
import com.usian.model.behavior.pojos.ApFollowBehavior;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description:
 * @Auther:ASS
 * @Date:2023/3/2 19:41
 */
@RestController
@RequestMapping("/api/v1/followbehavior")
public class ApFollowBehaviorController {

    @Autowired
    private ApFollowBehaviorService apFollowBehaviorService;

    /**
     *  article 远程调用 提供查询用户关注行为接口
     * @param entryId
     * @param articleId
     * @param followId
     * @return
     */
    @GetMapping("/findFollowBehavior/{entryId}/{articleId}/{followId}")
    public List<ApFollowBehavior> findFollowBehavior(@PathVariable Integer entryId, @PathVariable Integer articleId, @PathVariable  Integer followId){

      return  apFollowBehaviorService.list(Wrappers.<ApFollowBehavior>lambdaQuery().eq(ApFollowBehavior::getEntryId, entryId)
                .eq(ApFollowBehavior::getArticleId, articleId).eq(ApFollowBehavior::getFollowId, followId));
    }
}
